home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8362 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: tmpnews.crd.ge.com!rebecca!rpi!not-for-mail
  2. From: clamage@Eng.Sun.COM (Steve Clamage)
  3. Newsgroups: comp.lang.c++.moderated,comp.lang.c++
  4. Subject: Re: enum expression is IF statement
  5. Date: 17 Feb 1996 02:55:55 -0000
  6. Organization: Sun Microsystems Inc., Mountain View, CA
  7. Sender: cppmods@netlab.cs.rpi.edu
  8. Approved: vandevod@cs.rpi.edu
  9. Message-ID: <4g3g3r$7as@netlab.cs.rpi.edu>
  10. References: <4fq7dc$pac@netlab.cs.rpi.edu> <4g1pj9$pqg@netlab.cs.rpi.edu>
  11. NNTP-Posting-Host: netlab.cs.rpi.edu
  12. X-Original-Date: 17 Feb 1996 01:26:55 GMT
  13.  
  14. gstern@earth.usa.net (Greg Sternberg/PDS Inc) writes:
  15.  
  16. >   You're making the assumption that the compiler is numbering your enums
  17. >   sequentially from 0 - since the standard says nothing about how the
  18. >   compiler could number your enums it could very well be using 0x1, 0x2, 
  19. >   0x4, and 0x8.
  20.  
  21. It has always been the rule in C and C++ that if you do not supply
  22. values for enumerators, they are numbered sequentially from zero.
  23. You can find the rule in K&R1 (1978) and in the current draft
  24. C++ standard (1996).
  25. --
  26. Steve Clamage, stephen.clamage@eng.sun.com
  27.  
  28.       [ Articles to moderate: mailto:c++-submit@netlab.cs.rpi.edu ]
  29.       [  Read the C++ FAQ: http://www.connobj.com/cpp/cppfaq.htm  ]
  30.       [  Moderation policy: http://www.connobj.com/cpp/guide.htm  ]
  31.       [      Comments? mailto:c++-request@netlab.cs.rpi.edu       ]
  32.